﻿
namespace Data.Repository
{
	using System.Linq;

	public class ProductReviewHelpfulnessRepository : Data.Repository.IProductReviewHelpfulnessRepository
    {
        private LinqToECommerceDBDataContext _dbContext;
        
        #region IProductReviewHelpfulnessRepository Members

        public int CreateNewProductReviewHelpfulness(Data.Entity.ProductReviewHelpfulness theNewProductReviewHelpfulness)
        {
            if (theNewProductReviewHelpfulness == null)
            {
                return 0;
            }

			int result = 0;

			using(_dbContext = new LinqToECommerceDBDataContext())
			{
				result = _dbContext.ECommerce_ProductRvwHlpflnss_Create(theNewProductReviewHelpfulness.ProductReviewID, theNewProductReviewHelpfulness.UserID, theNewProductReviewHelpfulness.WasHelpful);
			}

			return result;
		}

        #endregion
    }
}
